<!DOCTYPE HTML>
<html>
<HEAD>
<meta charset="UTF-8">
<TITLE>登陆</TITLE>
</HEAD>
<body>
<?php
header("content-type:text/html;charset=UTF-8");
//进行连接数据库操作
include_once('DB.php');
//进行用户名验证操作

$username = $_POST["username"];
$password = $_POST["password"];

$DB =  new DB();

$res = $DB->get_all("select * from user where id =1");
//验证用户名密码
 if($res[0]['username']==$username&&$res[0]["password"]==$password){
     echo "登陆成功";
     //跳转
    echo "<script>location.href='data/admin/index.php';</script>"; 
 }

?>
    <h1>登陆</h1>
    <form action="" method="post">
        用户名：<input type="text" name="username"/></br>
        密码：<input type="password" name="password"></br>
        <input type="submit" name="submit" value="提交">      
    </form>
</body>
</html>